package com.buybuybuy.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.Window;

import com.buybuybuy.R;


public class Welcome extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.welcome);
initSystem();

    }
    private void initSystem(){
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
              mHandler.sendEmptyMessageAtTime(1,2000);
            }
        },3000);
    }


    public Handler mHandler = new Handler(){
        public void handleMessage(Message msg){
            if(msg.what == 1){
                Intent intent =new Intent(Welcome.this,MainActivity.class);
                startActivity(intent);
            }
        }
    };


    public void jumpWelcome(View view) {
        startActivity(new Intent(this,MainActivity.class));
    }
}

